define(["../logic/add", "../common/common"],
    function (pluginClass, c) {
        return {
            pluginClass: pluginClass,
            style: {
                backgroundColor: '#fff'

            },
            nocache: true,
            root: ["mainvlayout", "personSelector", "atpersonSelector", "file_upload_input"],
            components: {

                file_upload_input: {
                    type: "input",
                    mode: "file",
                    ref: true,
                    className: "task-input-file-upload",
                    style: {
                        position: "absolute",
                        opacity: "0",
                        top: -100,
                        visible: "hidden",
                        cursor: "pointer"
                    }
                },
                personSelector: {
                    ref: true,
                    type: "personselector"
                },
                atpersonSelector: {
                    ref: true,
                    title: "@TA查看",
                    mod: 3,
                    type: "personselector"
                },
                mainvlayout: {
                    type: "vbox",
                    style: {
                        height: "100%",
                        width: "100%"
                    },
                    items: [{
                        root: ["main_header"],
                        style: {
                            height: "40px"
                        }
                    },
                        {
                            root: ["main_body"],
                            style: {}
                        }]
                },

                main_header: {
                    type: "view",
                    className: "yy-unselect",
                    style: {
                        display: "table",
                        background: "#f5f5f5",
                        borderBottom: "1px solid #eee",
                        height: "100%",
                        width: "100%",
                        paddingRight: "20px",
                        paddingLeft: "20px"

                    },
                    root: ['add_title', 'add_close_button']
                },
                add_close_button: {
                    style: {
                        display: "table-cell",
                        textAlign: "right",
                        color: "#ccc",
                        verticalAlign: "top",
                        fontSize: 20,
                        cursor: "pointer"
                    },
                    type: "icon",
                    font: 'icomoon_e90a'
                },
                add_title: {
                    style: {
                        display: "table-cell",
                        fontSize: "14px",
                        verticalAlign: "middle"
                    },
                    type: 'text',
                    text: '选择模板'
                },
                main_body: {
                    type: "view",
                    ref: true,
                    style: {
                        width: "100%",
                        height: "100%",
                        overflow: "auto",
                        padding: "14px 18px 0px 18px"
                    },
                    root: ["main_body_inner_statusview", "empty_view"]
                },
                empty_view: {
                    type: "view",
                    style: {
                        height: 180
                    }
                },

                common_calendar: {
                    type: "datepicker",
                    wrapperClassName: "dc-common-caendar-wrapper",
                    ref: true,
                    style: {
                        position: "absolute",
                        top: 0,
                        left: 0,
                        visibility: "hidden"
                    }
                },

                main_body_inner_statusview: {
                    ref: true,
                    type: "statusview",
                    defaultKey: "template_wrap"
                },
                template_wrap: {
                    type: "view",
                    style: {
                        overflow: "auto"
                    },
                    root: ["template_repeat"]
                },

                template_repeat: {
                    className: 'template_repeat_hover',
                    type: "repeat",
                    style: {
                        overflow: "hidden"
                    },
                    itemStyle: {
                        // cursor: 'pointer',
                        width: "50%",
                        display: 'block',
                        float: 'left',
                        padding: '0px 5px 14px 5px',
                        // marginRight: 8,
                        // marginBottom: 8,
                        // height: 90,
                        // border: "1px solid #f2f2f2",
                        // borderRadius: "4px",
                        // borderTop: "5px solid #bcf4e1",
                        // backgroundColor: "#fff",
                        // paddingLeft:"15px",
                        // paddingRight:"15px",
                        // textAlign:"left"
                    },
                    root: ['template_item']
                },
                template_item: {
                    type: "view",
                    style: {
                        cursor: 'pointer',
                        display: 'block',
                        float: 'left',
                        width: "100%",
                        // marginRight: 8,
                        // marginBottom: 8,
                        height: 90,
                        border: "1px solid #f2f2f2",
                        borderRadius: "4px",
                        borderTop: "5px solid #bcf4e1",
                        backgroundColor: "#fff",
                        paddingLeft: "15px",
                        paddingRight: "15px",
                        textAlign: "left"
                    },
                    root: ['template_name', 'template_content']
                },
                template_name: {
                    style: {
                        marginTop: 16,
                        marginBottom: 5,
                        color: '#666666',
                        fontSize: '16px',
                        whiteSpace: 'nowrap',
                        textOverflow: 'ellipsis',
                        overflow: 'hidden'
                    },
                    type: 'text',
                    text: '标题',
                    text_bind: 'title'
                },
                template_content: {
                    style: {
                        color: '#999999',
                        fontSize: '14px',
                        whiteSpace: 'nowrap',
                        textOverflow: 'ellipsis',
                        overflow: 'hidden'
                    },
                    type: 'text',
                    text: '标题',
                    text_bind: 'describe'
                },
                main_body_inner: {
                    type: "view",
                    ref: true,
                    style: {
                        height: "100%",
                        overflow: "auto"
                    },
                    root: ["diaryTime_Timelabel","diaryTime_Time", "range_personselector_title", "range_personselector","add_dailyrender", 'personselector_group', 'uploader', 'bottom_buttons', "common_calendar",]
                },
                diaryTime_Timelabel:{
                    type:"text",
                    text:"日志日期",
                    style:{
                        fontSize: "14px",
                        color: "#666666",
                        display: "block",
                        lineHeight: "28px"
                    }
                },

                diaryTime_Time: {
                    ref: true,
                    readonly:true,
                    style:{
                        width:"100%",
                        marginBottom:"10px"
                    },
                    type: 'datepicker',
                },


                uploader: {
                    style: {
                        marginBottom: '15px',
                    },
                    type: 'view',
                    root: ['uploader_text', 'uploader_button', "uploader_repeat"]
                },
                uploader_button: {
                    style: {
                        display: 'inline-block',
                        backgroundColor: '#1FDA9A',
                        width: 60,
                        height: 32,
                        border: 'none',
                        color: '#fff',
                        marginLeft: 14,
                    },
                    type: 'button',
                    title: '上传'
                },
                uploader_text: {
                    type: 'text',
                    text: '附件',
                    style: {
                        display: 'inline-block',
                        fontSize: '14px',
                        color: '#666666'
                    },
                },
                uploader_repeat: {
                    ref: true,
                    type: "repeat",
                    className: "uploader_repeat",
                    style: {
                        marginTop: 8
                    },
                    itemStyle: {
                        backgroundColor: "#ffffff",
                        height: 34,
                        lineHeight: "26px",
                        paddingLeft: 14
                    },
                    root: ["uploader_repeat_item", "uploader_repeat_item_del"]
                },
                uploader_repeat_item: {
                    type: "icon",
                    iconStyle: {
                        display: "inline-block",
                        verticalAlign: "middle",
                        width: 20,
                        height: 20,
                        lineHeight: "20px"
                    },
                    textStyle: {
                        fontSize: 14,
                        width: 300,
                        height: 14,
                        lineHeight: "14px",
                        marginLeft: 4,
                        color: "#666",
                        display: "inline-block",
                        verticalAlign: "middle",
                        overflow: 'hidden',
                        textOverflow: 'ellipsis'
                    },
                    style: {
                        textAlign: 'left'
                    },
                    src_bind: 'iconsrc',
                    text_bind: 'fileName'
                },
                uploader_repeat_item_del: {
                    type: "icon",
                    style: {
                        cursor: "pointer",
                        fontSize: 13,
                        color: "#c8c8c8",
                        position: "absolute",
                        right: 10,
                        top: 4
                    },
                    font: "icomoon_e90a"
                },
                personselector_group: {
                    type: "view",
                    root: ["at_personselector_title", "at_personselector"]
                },
                range_personselector_title: {
                    type: "text",
                    className:"required",
                    style: {
                        color: "#666",
                        fontSize: 14
                    },
                    text: "可见范围"
                },
                at_personselector_title: {
                    type: "text",
                    // className:"displaynone",
                    style: {
                        color: "#666",
                        fontSize: 14
                    },
                    text: "@TA查看"
                },
                range_personselector: {
                    type: "hbox",
                    className: "ds-person-selector",
                    style: {
                        cursor: "pointer",
                        minHeight: 40,
                        paddingLeft: 9,
                        border: "1px solid #eee",
                        borderRadius: "4px",
                        width: "100%",
                        marginBottom: 12,
                        marginTop: 6
                    },
                    items: [
                        {root: ["tips_repeat"], style: {verticalAlign: "middle"}},
                        {
                            root: ["add_range_icon"],
                            style: {
                                width: 30,
                                verticalAlign: "middle"
                            }
                        }
                    ]
                },
                repeat_nodata: {
                    type: "text",
                    ref: true,
                    style: {
                        fontSize: 14,
                        lineHeight:'14px'
                    },
                    text: "本部门可见"
                },
                tips_repeat: {
                    ref: true,
                    type: "repeat",
                    nodata: "repeat_nodata",
                    style: {
                        color: "#a6a8a9",
                        fontSize: "12px",
                        overflow: "hidden",
                    },

                    root: ["repeat_item"],
                    itemStyle: {
                        float: "left",
                        backgroundColor: "#F5F5F5",
                        borderRadius: "12px",
                        paddingLeft: 8,
                        paddingRight: 8,
                        marginBottom: 4,
                        paddingBottom: 2,
                        marginRight: "3px"
                    }
                },
                repeat_item: {
                    type: "icon",
                    textPos: "left",
                    defaultText:"",
                    font: "icomoon_e90a",
                    iconStyle: {
                        color: "#c8c8c8",
                        marginLeft: 5
                    },
                    style: {
                        color: "#666666"
                    },
                    text_bind: "name"
                },
                add_range_icon: {
                    type: "icon",
                    ref: true,
                    style: {
                        top: -4
                    },
                    iconStyle: {
                        fontSize: 19,
                        color: "#AAAAAA"
                    },
                    font: "icomoon_e90b"
                },

                at_personselector: {
                    type: "hbox",
                    className: "ds-person-selector",
                    style: {
                        paddingLeft:9,
                        cursor: "pointer",
                        minHeight: 40,
                        border: "1px solid #eee",
                        borderRadius: "4px",
                        width: "100%",
                        marginBottom: 12,
                        marginTop: 6
                    },
                    items: [
                        {root: ["at_tips_repeat"], style: {verticalAlign: "middle"}},
                        {
                            root: ["at_add_range_icon"],
                            style: {
                                width: 30,
                                verticalAlign: "middle"
                            }
                        }
                    ]
                },
                at_repeat_nodata: {
                    type: "text",
                    ref: true,
                    text: "提醒关键人员查看您的日志"
                },
                at_tips_repeat: {
                    ref: true,
                    type: "repeat",
                    nodata: "at_repeat_nodata",
                    style: {
                        color: "#a6a8a9",
                        fontSize: "12px",
                        overflow: "hidden",
                    },

                    root: ["at_repeat_item"],
                    itemStyle: {
                        float: "left",
                        backgroundColor: "#F5F5F5",
                        borderRadius: "12px",
                        paddingLeft: 8,
                        paddingRight: 8,
                        marginBottom: 4,
                        paddingBottom: 2,
                        marginRight: "3px"
                    }
                },
                at_repeat_item: {
                    type: "icon",
                    textPos: "left",
                    font: "icomoon_e90a",
                    iconStyle: {
                        color: "#c8c8c8",
                        marginLeft: 5
                    },
                    style: {
                        color: "#666666"
                    },

                    text_bind: "name"
                },
                at_add_range_icon: {
                    type: "icon",
                    ref: true,
                    style: {
                        top: -4
                    },
                    iconStyle: {
                        fontSize: 19,
                        color: "#AAAAAA"
                    },
                    font: "icomoon_e90b"
                },

                // range_icon: {
                //     style: {
                //         position: 'absolute',
                //         bottom: '8px',
                //         right: '12px',
                //         color: '#AAAAAA'
                //     },
                //     type: 'icon',
                //     font: 'icomoon_e90b'
                // },
                range_label: {
                    type: 'text',
                    text: '可见范围',
                    style: {
                        fontSize: 14,
                        color: '#666666',
                        lineHeight: '28px'
                    }
                },

                add_dailyrender: {
                    ref: true,
                    type: 'dailyrender',
                },
                bottom_buttons: {
                    style: {
                        textAlign: "right"
                    },
                    type: "view",
                    root: ['button_left', 'button_mid', 'button_right']
                },
                button_left: {
                    type: 'button',
                    title: '取消',
                    style: {
                        height: 40,
                        width: 110,
                        borderColor: '#eee',
                        color: '#666666',
                    }
                },
                button_mid: {
                    ref:true,
                    style: {
                        height: 40,
                        width: 110,
                        marginLeft: 13,
                        marginRight: 13,
                        borderColor: '#eee',
                        color: '#666666',
                    },
                    type: 'button',
                    title: '保存为草稿'
                },
                button_right: {
                    type: 'button',
                    title: '提交',
                    style: {
                        height: 40,
                        marginLeft: 10,
                        width: 110,
                        color: '#fff',
                        border: 'none',
                        backgroundColor: "#1FDA9A",
                    },
                },

                del_dialog: {
                    type: 'view',
                    style: {
                        backgroundColor: "#fff",
                        overflow: "hidden",
                        borderRadius: "4px",
                        width: "300px",
                        height: "165px",
                        paddingTop: "44px",
                        paddingBottom: "10px",
                        margin: "auto"
                    },
                    root: ["del_dialog_label", "del_dialog_btn_wrap"]
                },
                del_dialog_label: {
                    type: "text",
                    style: {
                        textAlign: "center",
                        fontSize: "16px",
                        color: "#666666"
                    },
                    text: "确认关闭吗？"
                },
                del_dialog_btn_wrap: {
                    type: "view",
                    style: {
                        marginTop: "28px",
                        textAlign: "center"
                    },
                    root: ["del_dialog_cancelbtn", "del_dialog_okbtn"]
                },
                del_dialog_cancelbtn: {
                    type: 'button',
                    mode: 1,
                    style: {
                        width: "80px",
                        height: "32px",
                        lineHeight: "32px",
                        border: "1px solid #eeeeee",
                        color: "#666666",
                        fontSize: "14px"
                    },
                    title: "取消"
                },
                del_dialog_okbtn: {
                    type: 'button',
                    mode: 2,
                    ref: true,
                    style: {
                        width: "80px",
                        height: "32px",
                        lineHeight: "32px",
                        backgroundColor: "#1FDA9A",
                        fontSize: "14px",
                        marginLeft: "20px"
                    },
                    title: "确定"
                }
            }
        };
    });
